package com.penghaisoft.microwms.material.web.outwarehouse.controller;

import com.penghaisoft.microwms.common.controller.BaseController;
import com.penghaisoft.microwms.common.dto.TransResult;
import com.penghaisoft.microwms.common.page.Pager;
import com.penghaisoft.microwms.common.wms.model.RawBack;
import com.penghaisoft.microwms.common.wms.model.RawStorage;
import com.penghaisoft.microwms.material.web.outwarehouse.service.IMaterialOutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: micro-wms
 * @description: 原材料出库demo
 * @author: zhangx
 * @create: 2018-05-08 09:34
 **/
@RestController
@RequestMapping("outwarehouse/rawback")
public class RawBackController extends BaseController {

    @Autowired
    private IMaterialOutService materialOutService;

    @PostMapping("list")
    public TransResult list(@RequestParam(name = "page", defaultValue = "1") int page,
                            @RequestParam(name = "rows", defaultValue = "10") int rows, RawBack rawBack) {

        Pager<RawBack> result = materialOutService.findRawBackListByCondition(page, rows, rawBack);
        return success(result);
    }
}
